<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<style>
			.mui-slider-indicator .mui-active.mui-indicator{
				background-color: #ff6464;
			}
		</style>
	</head>

	<body>
			
		<div class="mui-content">
			<!-- 引导页轮播图 -->
			<div id="slider" class="mui-slider">
				 <!-- mui-slider-loop -->
				<div class="mui-slider-group">
					<!-- 第一张 -->
					<div class="mui-slider-item">
						<a data-href="http://www.taobao.com">
							<img src="images/yidaoye1.png">
						</a>
					</div>
					<!-- 第二张 -->
					<div class="mui-slider-item">
						<a data-href="http://jd.com">
							<img src="images/yidaoye2.png">
						</a>
					</div>
					<!-- 第三张 -->
					<div class="mui-slider-item">
						<a data-href="http://youku.com">
							<img src="images/yidaoye3.png">
						</a>
						<button type="button" class="mui-btn mui-btn-danger" id="tiyan" style="position: absolute;bottom: 40px;left: 50%;margin-left: -81px;padding: 10px 48px; font-size: 16px;">
							立即体验
						</button>
					</div>
				</div>
				<div class="mui-slider-indicator">
					<div class="mui-indicator mui-active"></div>
					<div class="mui-indicator"></div>
					<div class="mui-indicator"></div>
				</div>
			</div>
		</div>
		
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			
			mui.init({
				swipeBack:true //启用右滑关闭功能
			})
			
			mui.plusReady(function () {
				// 设置轮播图的大小：设为手机屏幕的大小
				// 获取手机屏幕的大小：宽度、高度
				let w = plus.screen.resolutionWidth;
				let h = plus.screen.resolutionHeight;
				
				// 设置图片大小
				let imgs = document.querySelectorAll('.mui-slider-item img');
				for(let i=0; i<imgs.length; i++){
					imgs[i].style.width = w + 'px';
					imgs[i].style.height = h + 'px';
					
					// 点击图片标签，跳转
					var embed;
					imgs[i].addEventListener('tap',function(){
						
						let href = this.parentNode.getAttribute('data-href');
						mui.openWindow({
							url : href,
							createNew: true
						});
						// let web = plus.webview.create(href,'weburl');
						// web.show();
						
					})
					
				}
				
				// 点击“立即体验”
				mui('#tiyan')[0].addEventListener('tap',function(){
					// 创建main窗口
					// let main = plus.webview.create('main.html','main');
					// main.show();
					
					// 记录体验状态
					plus.storage.setItem('isShow','true');
					
					mui.openWindow({
						url: 'main.html',
						show: {
							aniShow: 'none',
							duration: 10
						},
						waiting: {
							title:'正在加载...'
						}
					});
				})
				
			})
			
		</script>
	</body>

</html>
